const { VantResolver } = require('@vant/auto-import-resolver')
const AutoImport = require('unplugin-auto-import/webpack')
const Components = require('unplugin-vue-components/webpack')

module.exports = {

  chainWebpack: (config) => {
    // vant按需引入
    config.plugin('unplugin-auto-import/webpack').use(AutoImport.default({ resolvers: [VantResolver()] }))
    config.plugin('unplugin-vue-components/webpack').use(Components.default({ resolvers: [VantResolver()] }))
  }
}
